#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <math.h> 
#include <ctype.h> 
#include <time.h> 
#include <assert.h>

typedef long long LL;
LL f[100010] = {0};
int n, m;

int main()
{
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++)
	{
		LL x = 0;
		scanf("%lld", &x);
		f[i] += x;
		f[i + 1] -= x;
	}

	while (m--)
	{
		LL l, r, k;
		scanf("%lld%lld%lld", &l, &r, &k);
		f[l] += k;
		f[r + 1] -= k;
	}

	for (int i = 1; i <= n; i++)
	{
		f[i] += f[i-1];
		printf("%lld ", f[i]);
	}

	return 0;
}

